package br.ufc.ck0017.ir.translate;

import br.ufc.ck0017.ir.tree.CJUMP.LogicalOperator;
import br.ufc.ck0017.ir.tree.IR;
import br.ufc.ck0017.ir.tree.IRNode;
import br.ufc.ck0017.temp.Label;

public class LogicalCx extends TranslateCx {
    private final LogicalOperator operator;
    private final IRNode left;
    private final IRNode right;

    public LogicalCx(LogicalOperator operator, IRNode left, IRNode right) {
        this.operator = operator;
        this.left = left;
        this.right = right;
    }

    @Override
    public IRNode unCx(Label trueLabel, Label falseLabel) {
        return IR.CJUMP(operator, left, right, trueLabel, falseLabel);
    }
}
